package derivable;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;

/**
 * @author Henrik Wall
 * @author Rudolf Schmidt
 * @author Eugen Nemirowski
 */
public class AssertDerives {
	/**
	 * Asserts that one {@link Derivable} derives the other.
	 * 
	 * @param expected first statement
	 * @param actual second statement
	 * @throws AssertionError if the assertion is wrong
	 */
	public static <T extends Derivable<T>> void assertDerives(final T expected, final T actual) {
		assertTrue(expected + " does not derive " + actual, expected.derives(actual));
	}

	/**
	 * Asserts that one {@link Derivable} does not derive the other.
	 * 
	 * @param expected first statement
	 * @param actual second statement
	 * @throws AssertionError if the assertion is wrong
	 */
	public static <T extends Derivable<T>> void assertNotDerives(final T expected, final T actual) {
		assertFalse(expected + " derives " + actual, expected.derives(actual));
	}
}